package com.dream.keigezhushou.Activity.pop;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dream.keigezhushou.R;


/**
 * Created by mxmf-001 on 17/2/24.
 */

public class MoreWindow extends DialogBase {


    TextView popTitle;
    LinearLayout linear_download;
    LinearLayout l_singCounts;
    LinearLayout l_addToCollecte;
    LinearLayout l_share;
    LinearLayout l_message;
    private Context context;

    private ItemClickListener itemClickListener;


    /**
     * @param contentView
     * @param context
     * @param width
     * @param height      设置高度
     */
    public MoreWindow(final View contentView, final Context context, int width, int height) {
        super(contentView, context, width, height);
        this.context = context;

        popTitle = (TextView) contentView.findViewById(R.id.pop_title);
        linear_download = (LinearLayout) contentView.findViewById(R.id.l_downLoad);
        l_message = (LinearLayout) contentView.findViewById(R.id.l_message);
        popTitle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (itemClickListener != null) {
                    itemClickListener.onClick();
                }
                dismiss();

            }
        });

        l_message.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//
                if (itemClickListener != null) {
                    dismiss();
                    itemClickListener.onSingDetail();

                }


            }
        });


    }


    public void setItemListener(ItemClickListener itemClickListener) {

        this.itemClickListener = itemClickListener;
    }


    public interface ItemClickListener {

        public void onClick();

        public void onSingDetail();
    }


}
